#!/bin/bash
url="http://localhost:8000/notify"
headers="Content-Type: application/json"

repo_path=$(git rev-parse --show-toplevel)
commit_hash=$(git rev-parse HEAD)
commit_message=$(git log -1 --pretty=%B)

json_data='{
    "name": "'$(basename $repo_path)'",
    "repo_path": "'"$repo_path"'",
    "commit_hash": "'"$commit_hash"'",
    "commit_message": "'"$commit_message"'"
}'

curl -X POST -H "$headers" -d "$json_data" $url